## 当前版本 [1.9.x]
https://www.npmjs.com/package/andy-aui

感谢
1. https://30secondsofcode.org/

@@include("./polyfill.mdx")
@@include("./sham.mdx")

## 定义
@@include("./basic/struct.mdx")


## 全局
@@include("./basic/nodex.mdx")
@@include("./basic/browser.mdx")
@@include("./aui/error.mdx")


### 剪贴板
核心
```javascript
 function copyTextToClipboard(text) {
    let ret = false;
    let textArea = document.createElement("textarea");

    textArea.style.position = 'fixed';
    textArea.style.top = 0;
    textArea.style.left = 0;

    textArea.style.width = '2em';
    textArea.style.height = '2em';
    textArea.style.padding = 0;

    textArea.style.border = 'none';
    textArea.style.outline = 'none';
    textArea.style.boxShadow = 'none';
    textArea.style.background = 'transparent';
    textArea.value = text;

    document.body.appendChild(textArea);

    textArea.select();

    try {
        ret = document.execCommand('copy');
    } catch (err) {
      throw err;
    }

    document.body.removeChild(textArea);
    return ret;
}
```

#### Error

```javascript
class ClipboardDataError extends ExtendableError {
    constructor() {
        super("set ClipboardData error");
    }
}
```

#### aui.setClipboardData [> 1.7.x] 

example
```javascript
aui.setClipboardData('data')
.then(function() {
    console.log("success");  
})["catch"](function(e) {
    console.log("error");
})
```

#### aui.getClipboardData [stage 3]

获取粘贴板中文字 

```javascript
export let getClipboardData = (function() {
  let __clipboardData = null;
  document.addEventListener('copy', function(event) {
    __clipboardData= event.clipboardData || window.clipboardData || event.originalEvent.clipboardData;
    event.preventDefault();
  });
  return function(type = 'Text') {
    if (window.clipboardData.getData) {
      return window.clipboardData.getData(type)
    } else {
      if (__clipboardData && __clipboardData.getData) {
        return __clipboardData.getData(type)
      }
      return null;
    }
  }  
})()
```

### debug
#### aui.debug [> 1.7.x] <has-tested></has-tested>

```javascript
aui.debug = false;
```

## 默认模块
@@include("./aui/utils.mdx")
@@include("./aui/browser.mdx")
@@include("./aui/logger.mdx")

## 可选模块
@@include("./aui/validate.mdx")
@@include("./aui/random.mdx")
@@include("./aui/adapter.mdx")
@@include("./aui/obj.mdx")
@@include("./aui/string.mdx")
@@include("./aui/array.mdx")
@@include("./aui/cast.mdx")
@@include("./aui/filter.mdx")
@@include("./aui/color.mdx")
@@include("./aui/intl.mdx")
@@include("./aui/function.mdx")
@@include("./aui/math.mdx")

